package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo07 {
    public static void main(String[] args) {
        try ( Connection conn=DBUtils.getConn()){
            Statement s=conn.createStatement();
            ResultSet rs= s.executeQuery("select  * from hero");
            while (rs.next()){
                Object o = rs.getObject(2);
                Object w = rs.getObject(3);
                System.out.println(o+":"+w);
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
